NEW


5 REM AWARI - +16K MC-10.  COULD FIT IN 4K IF INSTRUCTIONS WERE REMOVED
30 SP$="                                "
35 GOSUB2000
40 DATA 0
50 DIM B(13),G(13),F(50):READ N
60 CLS
61 LL=0:V$="AWARI":GOSUB1000
62 LL=1:V$="CREATIVE COMPUTING":GOSUB1000
63 LL=2:V$="MORRISTOWN, NEW JERSEY":GOSUB1000

65 E=0
70 FOR I=0 TO 12:B(I)=3:NEXT I
80 C=0:F(N)=0:B(13)=0:B(6)=0
90 GOSUB360
100 PRINT@256,LEFT$(SP$,31);:PRINT@288,LEFT$(SP$,31);
101 PRINT@256,"YOUR MOVE";:GOSUB 230
110 IF E=0 THEN 180
120 IF M=H THEN GOSUB 220
130 IF E=0 THEN 180
140 REM
141 PRINT@352,LEFT$(SP$,31);:PRINT@352,"MY MOVE IS ";:GOSUB 520:GOSUB360
150 IF E=0 THEN 180
160 IF M=H THEN PRINT@366,"AND ";:GOSUB 520:GOSUB360
170 IF E>0 THEN 90
180 GOSUB360:PRINT@384,"GAME OVER-";
190 D=B(6)-B(13):IF D<0 THEN PRINT "I WIN BY";-D;"POINTS";:GOSUB1010:GOTO 60
200 N=N+1:IF D=0 THEN PRINT "DRAWN GAME";:GOSUB1010:GOTO 60
210 PRINT "YOU WIN BY";D;"POINTS";:GOSUB1010:GOTO 60
220 PRINT@288,LEFT$(SP$,31);:PRINT@288,"AGAIN";
230 INPUT M$:M=ASC(M$)-64:IF M<7 THEN IF M>0 THEN M=M-1:GOTO 250
240 REM ILLEGAL MOVE
241 FOR JJ=1 TO 3
242 PRINT@480,"-ILLEGAL MOVE-";:SOUND1,2:PRINT@480,LEFT$(SP$,31);
245 NEXT JJ
246 GOTO 220:REM END ILLEGAL MOVE

250 IF B(M)=0 THEN 240
260 H=6:GOSUB 280
270 GOTO 360

280 K=M:GOSUB 460
290 E=0:IF K>6 THEN K=K-7
300 C=C+1:IF C<9 THEN F(N)=F(N)*6+K
310 FOR I=0 TO 5:IF B(I)<>0 THEN 340
320 NEXT I
330 RETURN
340 FOR I=7 TO 12:IF B(I)<>0 THEN E=1:RETURN
350 GOTO 320

360 REM PRINT THE BOARD
361 PRINT@128,"   ";
370 FOR I=12 TO 7 STEP -1:GOSUB 440
380 NEXT I
390 PRINT:I=13:GOSUB 440
400 PRINT "                       ";:PRINT B(6):PRINT "   ";
410 FOR I=0 TO 5:GOSUB 440
420 NEXT I
421 PRINT:PRINT "   ";
422 FOR I=1 TO 6:PRINT"  ";CHR$(I+64);" ";:NEXT:PRINT
430 RETURN:REM END PRINT THE BOARD

440 IF B(I)<10 THEN PRINT " ";
450 PRINT B(I);:RETURN

460 P=B(M):B(M)=0
470 FOR P=P TO 1 STEP -1:M=M+1:IF M>13 THEN M=M-14
480 B(M)=B(M)+1:NEXT P
490 IF B(M)=1 THEN IF M<>6 THEN IF M<>13 THEN IF B(12-M)<>0 THEN 510
500 RETURN
510 B(H)=B(H)+B(12-M)+1:B(M)=0:B(12-M)=0:RETURN
520 D=-99:H=13
530 FOR I=0 TO 13:G(I)=B(I):NEXT I
540 FOR J=7 TO 12:IF B(J)=0 THEN 680
550 G=0:M=J:GOSUB 460
560 FOR I=0 TO 5:IF B(I)=0 THEN 610
570 L=B(I)+I:R=0
580 IF L>13 THEN L=L-14:R=1:GOTO 580
590 IF B(L)=0 THEN IF L<>6 THEN IF L<>13 THEN R=B(12-L)+R
600 IF R>Q THEN Q=R
610 NEXT I
620 Q=B(13)-B(6)-Q:IF C>8 THEN 660
630 K=J:IF K>6 THEN K=K-7
640 FOR I=0 TO N-1:IF F(N)*6+K=INT(F(I)/6^(7-C)+.1) THEN Q=Q-2
650 NEXT I
660 FOR I=0 TO 13:B(I)=G(I):NEXT I
670 IF Q>=D THEN A=J:D=Q
680 NEXT J
690 M=A:PRINT CHR$(65-7+M);:GOTO 280
700 FOR I=0 TO N-1:PRINT B(I):NEXT I
710 END

1000 SL=INT(LL*32+(32-LEN(V$))/2):PRINT@SL,V$;:RETURN
1010 LL=15:V$="HIT SPACE BAR":GOSUB1000
1030 V$=INKEY$:IF V$="" THEN 1030
1040 V$=INKEY$:IF V$<>"" THEN 1040
1050 V$="                ":GOSUB1000
1060 RETURN

2000 CLS:LL=0:V$="AWARI":GOSUB1000:PRINT
2030 PRINT"SOWING COUNT & CAPTURE GAME"
2040 PRINT"VARIANT. AT EACH TURN, CHOOSE"
2050 PRINT"A PIT (A-F) TO SOW.  IF YOUR"
2060 PRINT"LAST BEAN LANDS IN YOUR STORE"
2070 PRINT"YOU GET ONE MORE MOVE (ONCE"
2080 PRINT"PER TURN). IF IT LANDS IN AN"
2090 PRINT"EMPTY PIT, YOU CAPTURE THAT"
2100 PRINT"BEAN AND ANY IN THE PIT"
2110 PRINT"OPPOSITE IT."
2120 PRINT"THE GAME ENDS WHEN A PLAYER"
2130 PRINT"CAN'T MAKE A MOVE ON HIS"
2140 PRINT"OR HER TURN."
2150 GOSUB1010:RETURN



